﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Streambolics.Tablet
{
    /// <summary>
    ///     An InkAdapter that pastes the recognized text as
    ///     the text of the attached control.
    /// </summary>

    public class InkTextAdapter : InkAdapter
    {
        protected override void OnInkAnalyzed (InkAnalysisEventArgs e)
        {
            base.OnInkAnalyzed (e);
            if (!e.Accepted)
            {
                try
                {
                    AttachedControl.Text = e.Interpretation;
                    e.Accepted = true;
                }
                catch
                {
                }
            }
        }
    }
}
